package test;

import java.util.*;

public class CollectionDemo {
    public static void main(String[] args) {
        /*List list = new ArrayList();
//        ArrayList list1 = new ArrayList();//不易转换类型
        list.add("西游记");
        list.add("水浒传");
        System.out.println(list);
        System.out.println(list.size());
//        list.clear();
        System.out.println(list);
        System.out.println(list.isEmpty());
        System.out.println(list.contains("西游记"));
        List l = new LinkedList();
        l.add("红楼梦");
        System.out.println(list.containsAll(l));
        list.add("红楼梦");
        list.add("水浒传");
        System.out.println(list);
        list.remove("水浒传");
        System.out.println(list);
        System.out.println(l);
        System.out.println(list.removeAll(l));
        System.out.println(list);
        list.retainAll(l);
        System.out.println(list);
        list.add("红楼梦");
        System.out.println(list.equals("红楼梦"));
        System.out.println(list.equals(l));
        System.out.println(list.toArray());
        System.out.println(list.hashCode());
        System.out.println(list.iterator());
        list.add("水浒传");
        Iterator it = list.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
            it.remove();
        }
        System.out.println(list);*/




    }
}
